#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<QMenuBar>
#include<QAction>
#include<QTextEdit>
#include<QDebug>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    this->setWindowTitle("我的记事本");

    QMenuBar* menubar=menuBar();
    this->setMenuBar(menubar);

    QMenu* menu1=new QMenu("文件");
    QMenu* menu2=new QMenu("编辑");
    QMenu* menu3=new QMenu("构建");

    menubar->addMenu(menu1);
    menubar->addMenu(menu2);
    menubar->addMenu(menu3);

    QAction* act1=new QAction("open");
    QAction* act2=new QAction("close");
    QAction* act3=new QAction("create");

    menu1->addAction(act1);
    menu1->addSeparator();
    menu1->addAction(act2);
    menu1->addAction(act3);

     edit=new QTextEdit(this);
    this->setCentralWidget(edit);
    edit->setPlaceholderText("此处编写代码");
   // connect(edit,&QTextEdit::textChanged,this,&MainWindow::handle);


}

void MainWindow::handle()
{
}


MainWindow::~MainWindow()
{
    delete ui;
}

